<?php
/**
 * Template Name: About - Testimonial
 * Description: The testimonials page for About
 *
 * @package ManterRealty
 * 
 */

get_header(); ?>
		
        <div class="kc_wrap kc_section">
        	<?php if ( have_posts() ) : ?>
            	<?php while ( have_posts() ) : the_post(); ?>
					<div class="cols cols_2cols about_cols about_cols_2cols clearfix">
                   
                    	<div class="col col_1">
                        	<div class="col_pad">
                            
                            	<div class="sec_nav_wrap">
									<div class="sec_nav_pad">
										<ul class="sec_nav">
										<?php
											$parent = 38; // About
											$args=array(
											  'child_of' => $parent
											);
											$pages1 = get_pages($args);  
											if ($pages1) {
											  $pageids = array();
											  foreach ($pages1 as $page) {
												$pageids[]= $page->ID;
											  }
											
											  $args=array(
												'title_li' => '',
												'include' =>  $parent . ',' . implode(",", $pageids)
											  );
											  wp_list_pages($args);
											}
										?> 
										</ul>
									</div>
                                </div>
                                
                                <div class="callout_wrap">
                                	<div class="callout_pad">
                                    	
                                    </div>
                                </div>
                                
                            </div>
                        </div>
                    	
                        <div class="col col_2">
							<div class="intro_content">
								<?php the_content(); ?>
							</div>
							<?php 
								$parent = url_to_postid($root.'/about-manter-realty/testimonials');
								$testimonials = get_pages('child_of='.$parent.'&parent='.$parent.'&sort_column=menu_order&sort_order=asc');
								
								foreach($testimonials as $testimonial) { 
									$testContent = get_post($testimonial->ID)->post_content;
									$vals = get_post_custom_values('testimonial_author',$testimonial->ID);
									$testAuthor = $vals[0];
									
									?>
									<div class="testimonial_wrap">
										<div class="testimonial_pad">
											<?php echo($testContent); ?>
											<?php if(testAuthor) { ?>
												<span class="testimonial_by">
													<?php echo($testAuthor); ?>
												</span>
											<?php } ?>
											
										</div>
									</div>
								<?php }
                            ?>
                        </div>
						
                    </div>
				<?php endwhile; ?>
             <?php endif; ?>
        </div>

<?php get_footer(); ?>